package demo1;

class A {
    public void print() {
        System.out.println("A::print()");
    }
}

class B extends A{
    public void print() {
        System.out.println("B::print()");
    }
}

public class Test1 {
    public static void main(String[] args) {
        A aa =  new B();
        aa.print();
    }
}
